#!/bin/sh 

set -e

HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`

if [ install = "$1" ] || dpkg --compare-versions "$2" lt 1.1.0-0linaro2; then
	if [ ! -d /usr/lib/libjpeg-divert ] 
        then
		mkdir -p /usr/lib/libjpeg-divert
        fi

 	dpkg-divert --package libjpeg-turbo62 --rename --divert /usr/lib/libjpeg-divert/libjpeg.so.62.0.0 \
                --add /usr/lib/$HOST_MULTIARCH/libjpeg.so.62.0.0
 	dpkg-divert --package libjpeg-turbo62 --rename --divert /usr/lib/libjpeg-divert/libjpeg.so.62 \
                --add /usr/lib/$HOST_MULTIARCH/libjpeg.so.62

fi

#DEBHELPER#
